/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package serverCommunication.model;

import java.util.ArrayList;
import java.util.Date;

/**
 *
 * @author RodriguesMoises
 */
public class TrafficPoint{
    private long pointId;
    private int latitude;
    private int longitude;
    private Image[] images;
    private ArrayList<Long> users;
    private ArrayList<String> descriptions;
    private Date time;

    public Image[] getImages() {
        return images;
    }
    
    public String getImagesAsString()
    {
        if(images == null)
            return "null";
        String string = "";
        for(Image image : images)
        {
            string += image;
        }
        return string;
    }
    
    public String getArrayListAsString(ArrayList arrayList)
    {
        String string = "";
        if(arrayList != null)
        {
            string = "[";
            for(int i = 0; i < arrayList.size(); i++)
            {
                if(i != 0)
                {
                    string += "|, ";
                }
                string += arrayList.get(i);
            }
            string += "]";
        }
        else
        {
            string = null;
        }
        return string;
    }

    public void setImages(Image[] images) {
        this.images = images;
    }

    public Date getTime() {
        return time;
    }

    public void setTime(Date time) {
        this.time = time;
    }

    
    public long getPointId() {
        return pointId;
    }

    public void setPointId(long pointId) {
        this.pointId = pointId;
    }
    
    public ArrayList<String> getDescriptions() {        
        return descriptions;
    }

    public void setDescriptions(ArrayList<String> descriptions) {
        this.descriptions = descriptions;
    }

    public int getLatitude() {
        return latitude;
    }

    public void setLatitude(int latitude) {
        this.latitude = latitude;
    }

    public int getLongitude() {
        return longitude;
    }

    public void setLongitude(int longitude) {
        this.longitude = longitude;
    }

    public ArrayList<Long> getUsers() {
        return users;
    }

    public void setUsers(ArrayList<Long> users) {
        this.users = users;
    }

    @Override
    public String toString() {
        return "|TrafficPoint{" + "pointId=" + pointId + ",| latitude=" + latitude + ",| longitude=" + longitude + ",| images=" + getImagesAsString() + ",| users=" + getArrayListAsString(users) + ",| descriptions=" + getArrayListAsString(descriptions) + ",| time=" + time.toLocaleString() + "}TrafficPoint|";
    }
}